/*
 * Copyright (C) 2008
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.googlecode.sca4idea.providers;

import com.googlecode.sca4idea.psi.SCAComponentTagPsiElement;
import com.intellij.psi.xml.XmlTag;
import org.jetbrains.annotations.Nullable;

/**
 * Provides details of an SCA Provider supported by the plugin. SCA providers support different ranges of
 * implementations.
 */
public interface SCAProvider {
    /**
     * Retrieves the unique identifier of this provider.
     * @return the unique identifier.
     */
    String getId();

    /**
     * Retrieves the display name of the SCA Provider.
     * @return the display name of this provider.
     */
    String getDisplayName();

    /**
     * Requests that the provider register references to provide error-checking and navigation for implementations
     * that it supports.
     * @param registrar the registrar that will process the registrations.
     */
    void registerReferences(ProviderReferenceRegistrar registrar);

    /**
     * Retrieves a component tag psi element for the given tag.
     * @param tag the tag to retrieve the element for.
     * @return the psi element for the SCA Component, or null if no component implementation is matched.
     */
    @Nullable
    SCAComponentTagPsiElement getPSIElementForTag(XmlTag tag);

    /**
     * Retrieves whether this provider should always be active.
     * @return true - the provider should always be active.
     */
    boolean isAlwaysActive();
}
